package com.itstudio.myforumsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itstudio.myforumsystem.entity.Comment;
import com.itstudio.myforumsystem.service.CommentService;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface CommentMapper extends BaseMapper<Comment> {

@Select("select c.* ,u.avatar_url ,u.nickname from t_comment c left join sys_user u on c.user_id=u.id where c.article_id=#{articleId} order by id desc")
    List<Comment> findCommentDetail(Integer articleId);
}
